package com.ap.core.validation.info;

import com.ap.core.business.info.ValidationInfo;
import com.ap.core.validation.service.BusinessValidationService;

import java.util.List;

/**
 * This class is value object returned by validation service{@link BusinessValidationService} after validating jaxb object
 */
public class ValidationResult {

    private final List<ValidationInfo> failedRulesInfo;

    public ValidationResult(List<ValidationInfo> failedRulesInfo) {
        this.failedRulesInfo = failedRulesInfo;
    }

    public List<ValidationInfo> getFailedRulesInfo() {
        return failedRulesInfo;
    }

    public boolean isValid(){
        return failedRulesInfo == null ? true : failedRulesInfo.isEmpty();
    }
}
